﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAL;

/// <summary>
/// Description résumée de ActiviteSiteLinkService
/// </summary>
/// 
namespace BLL
{
    public class ActiviteSiteLinkService
    {
        private IActiviteSiteLinkManager activiteSiteLinkManager;

        public ActiviteSiteLinkService(IActiviteSiteLinkManager activiteSiteLinkManager)
        {
            this.activiteSiteLinkManager = activiteSiteLinkManager;
        }

        public ACTIVITE_SITE_LINK createActiviteSiteLink(int activiteId, int siteId)
        {
            ACTIVITE_SITE_LINK activiteSiteLink = new ACTIVITE_SITE_LINK();
            activiteSiteLink.ACTIVITEID = activiteId;
            activiteSiteLink.SITEID = siteId;

            try
            {
                this.activiteSiteLinkManager.addActiviteSiteLink(activiteSiteLink);
                return activiteSiteLink;
            }
            catch (Exception ex)
            {
                return null;
            }

        }

        public bool deleteActiviteSiteLink(int activiteId, int siteId)
        {
            return activiteSiteLinkManager.deleteActiviteSiteLink(activiteId, siteId);
        }

        public ACTIVITE_SITE_LINK getActiviteSiteLinkByIds(int activiteId, int siteId)
        {
            return activiteSiteLinkManager.getActiviteSiteLinkByIds(activiteId, siteId);
        }

        public List<ACTIVITE_SITE_LINK> getAllActiviteSiteLinks()
        {
            return this.activiteSiteLinkManager.getAllActiviteSiteLinks();
        }

    }
}